import React from 'react';
import Radio from 'components/config/radio';
import { Tooltip } from 'antd';
import PropTypes from 'prop-types';

export default class BGImageFillMode extends React.Component {

  static propTypes = {
    onChange: PropTypes.func,
    value: PropTypes.any,
  };

  render() {
    const { onChange, value } = this.props;
    const props = {
      onChange,
      value,
    };
    return (
      <Radio label="图片填充方式"
             {...props}
             options={[
               {
                 label: <Tooltip title="重复图像以铺满整个页面，适合纹理花纹背景"><span>平铺</span></Tooltip>,
                 value: 'repeat'
               },
               {
                 label: <Tooltip title="居中等比缩放，图片会有部分区域不可见"><span>覆盖</span></Tooltip>,
                 value: 'cover'
               },
               {
                 label: <Tooltip title="按最大宽高拉伸图片，图片会变形"><span>拉伸</span></Tooltip>,
                 value: 'full'
               }
             ]} />
    );
  }
}
